package com.easpeed.elevator.ui;

import static com.easpeed.comon.utils.KotlinextralKt.isUser;

import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;

import androidx.core.util.Consumer;

import com.baidu.location.BDLocation;
import com.bigyu.utils.Logger;
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.ClipboardUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.easpeed.common.CommonConsts;
import com.easpeed.comon.bean.AppOperateBean;
import com.easpeed.comon.bean.Authentication;
import com.easpeed.comon.bean.BaseData;
import com.easpeed.comon.bean.ChannelSettingBean;
import com.easpeed.comon.bean.DataBattery;
import com.easpeed.comon.consts.ChannelConsts;
import com.easpeed.comon.consts.ConstsApi;
import com.easpeed.comon.consts.CustomSetting;
import com.easpeed.comon.dialog.UploadCacheDataDialog;
import com.easpeed.comon.memorycache.CommonMemoryCache;
import com.easpeed.comon.socket_tool.SocketInfoActivity;
import com.easpeed.comon.ui.CommonRouteActivity;
import com.easpeed.comon.utils.ActivityLifecycleHelper;
import com.easpeed.comon.utils.ApiHelper;
import com.easpeed.comon.utils.CacheHelper;
import com.easpeed.comon.utils.CommonOperateUtils;
import com.easpeed.comon.utils.DownloadHelper;
import com.easpeed.comon.utils.KotlinextralKt;
import com.easpeed.comon.utils.LocationHelper;
import com.easpeed.comon.utils.NetHelper;
import com.easpeed.comon.utils.SendCommand;
import com.easpeed.comon.utils.SocketHelper;
import com.easpeed.elevator.BuildConfig;
import com.easpeed.elevator.R;
import com.easpeed.elevator.base.BaseActivity;
import com.easpeed.elevator.event.GetSerialMessageEvent;
import com.easpeed.elevator.serialport.Device;
import com.easpeed.elevator.serialport.SerialPortManager;
import com.easpeed.elevator.serialport2.Device2;
import com.easpeed.elevator.serialport2.SerialPortManager2;
import com.easpeed.elevator.utils.NoticeDialog;
import com.easpeed.elevator.utils.QRCodeDealUtils;
import com.easpeed.elevator.utils.WwViewHolder;
import com.easpeed.user.UserLoginActivity;
import com.easpeed.user.dialog.UserDialogHelper;
import com.google.gson.Gson;
import com.google.zxing.WriterException;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;

import java.util.HashMap;

import butterknife.ButterKnife;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;


public class MainActivity extends BaseActivity {

    private LinearLayout loadingView;
    private LinearLayout mainContent;
    private TextView timerText;
    private CountDownTimer countDownTimer;
    private static int COUNTDOWN_TIME = 5000; // 5秒
    private static final int INTERVAL = 1000; // 1秒
    private static boolean init = false;

    private Device mDevice;
    private String mDevicename = "/dev/ttyS2";//串口名字
    private String mBaudrates = "115200";//波特率

    private Device2 mDevice2;
    private String mDevicename2 = "/dev/ttyS3";//串口名字
    private String mBaudrates2 = "115200";//波特率  //921600   //115200

    private LocationHelper locationHelper;
    String str = "";
    String dvsZsl = "";
    String otdrZsl = "";
    String pdjl = "70";

    WwViewHolder holder;
    private Activity mActivity;
    private boolean isFirstUploadLocation = true;

    @Override
    protected void getIntentData(Bundle savedInstanceState) {

    }

    @Override
    protected void loadXml() {
        mActivity = this;
        if (BuildConfig.DEBUG) {
            COUNTDOWN_TIME = 1000;
        }
        locationHelper = new LocationHelper();
        locationHelper.init(this);
        locationHelper.testStartLocationService(this);
        locationHelper.setResultCallback(new Function1<BDLocation, Unit>() {
            @Override
            public Unit invoke(BDLocation bdLocation) {
                if (isFirstUploadLocation) {
                    isFirstUploadLocation = false;
                    netForUploadLocation();
                }
                return null;
            }
        });
        ToastUtils.showShort(CommonConsts.TAG);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);
        EventBus.getDefault().register(this);

        holder = new WwViewHolder(this, this.getWindow().getDecorView());

        loadingView = findViewById(R.id.loading_view);
        mainContent = findViewById(R.id.main_content);
        timerText = findViewById(R.id.timer_text);
        //使用缓存的比特率
        String bit = sp.getString("bit", "115200");
        mBaudrates2 = bit;
        sp.edit().putString("bitUsed", mBaudrates2).apply();

        initDevice();
        // 开始倒计时
        countDownTimer = new CountDownTimer(COUNTDOWN_TIME, INTERVAL) {
            int secondsRemaining = COUNTDOWN_TIME / 1000;

            @Override
            public void onTick(long millisUntilFinished) {
                secondsRemaining--;
                timerText.setText("串口初始化中，剩余时间：" + secondsRemaining);
            }

            @Override
            public void onFinish() {
                // 隐藏加载视图，显示主内容
                loadingView.setVisibility(View.GONE);
                mainContent.setVisibility(View.VISIBLE);
                init = true;
                timerText.setText("初始化完成!");
            }
        }.start();
        ApiHelper.checkVersion(versionBaseData -> {
            Logger.e("TAG", "checkVersion:" + versionBaseData);
            try {
                if (Integer.parseInt(versionBaseData.getData().getVersion()) > AppUtils.getAppVersionCode()) {
                    new DownloadHelper(this).init("更新应用", versionBaseData.getData().getUrl());
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        });

        if (!CacheHelper.instance().getBooleanValue("isUploadCache")) {
            new UploadCacheDataDialog().show(this);
        }
        if (!CustomSetting.getUse8ChannelData()) {
            holder.setGone(R.id.chanel_5, false);
            holder.setGone(R.id.chanel_6, false);
            holder.setGone(R.id.chanel_7, false);
            holder.setGone(R.id.chanel_8, false);
        }
    }

    private void getMaxMemoryInfo() {
        Runtime rt = Runtime.getRuntime();
        long maxMemory = rt.maxMemory();
        Logger.e("MaxMemory:", Long.toString(maxMemory / (1024 * 1024)));
        ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
        Logger.e("MemoryClass:", Long.toString(activityManager.getMemoryClass()));
        Logger.e("LargeMemoryClass:", Long.toString(activityManager.getLargeMemoryClass()));
    }

    @Override
    protected void initView() {
        SocketHelper.addResultListener(getClass().getSimpleName(), tcpData -> {
            if (!TextUtils.isEmpty(tcpData.getMsg())) {
                ToastUtils.showShort(tcpData.getMsg());
            }
            if (tcpData.getAny() instanceof ChannelSettingBean) {
                ChannelSettingBean channelSettingBean = (ChannelSettingBean) tcpData.getAny();
                Logger.e("TAG", channelSettingBean.toString());
                ((RadioGroup) holder.getView(R.id.layout_chanel)).getChildAt(channelSettingBean.getChannelIndex()).performClick();
                ToastUtils.showShort("切换通道成功");
            }
            // 获取电量
            if (tcpData.getAny() instanceof DataBattery && ((DataBattery) tcpData.getAny()).getType() == 0) {
                SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.commandSyncBattery), new Gson().toJson(new DataBattery(1, KotlinextralKt.getBatteryLevel(this))));
            }
            if (SendCommand.commandToStr(SendCommand.commandSyncOTDRSetting).equals(tcpData.getCommandStr())) {
                try {
                    HashMap<String, String> data = ((HashMap<String, String>) tcpData.getAny());
                    editor.putString("chanel_1_otdr", data.get("chanel_1"));
                    editor.putString("chanel_2_otdr", data.get("chanel_2"));
                    editor.putString("chanel_3_otdr", data.get("chanel_3"));
                    editor.putString("chanel_4_otdr", data.get("chanel_4"));
                    editor.putString("chanel_5_otdr", data.get("chanel_5"));
                    editor.putString("chanel_6_otdr", data.get("chanel_6"));
                    editor.putString("chanel_7_otdr", data.get("chanel_7"));
                    editor.putString("chanel_8_otdr", data.get("chanel_8"));

                    editor.commit();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            if (SendCommand.commandToStr(SendCommand.commandAppOperate).equals(tcpData.getCommandStr())) {
                try {
                    if (!isUser()) {
                        Bundle bundle = new Bundle();

                        final AppOperateBean bean = ((AppOperateBean) tcpData.getAny());
                        final int type = bean.getType();
                        switch (type) {
                            case 1:
                                break;

                            case 2:
                                bundle.putString("channel", channel);
                                bundle.putString("channelName", channelName);
                                bundle.putString("dvsZsl", dvsZsl);
                                bundle.putString("otdrZsl", otdrZsl);
                                bundle.putString("pdjl", pdjl);
                                bundle.putInt("channelIndex", selectChannel);

                                OpticTestingActivity.start(holder.mContext, bundle);
                                break;

                            case 3:
                                CommonOperateUtils.moveTo(ActivityLifecycleHelper.getCurrentActivity(), MainActivity.class);
                                break;
                            case 4:
                                bundle.putString("channel", channel);
                                bundle.putString("channelName", channelName);
                                bundle.putString("dvsZsl", dvsZsl);
                                bundle.putString("otdrZsl", otdrZsl);
                                bundle.putString("pdjl", pdjl);
                                bundle.putInt("channelIndex", selectChannel);
                                OTDROpticTestingActivity.start(holder.mContext, bundle);
                                break;
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            if (SendCommand.commandToStr(SendCommand.commandSyncDVSSetting).equals(tcpData.getCommandStr())) {
                try {
                    HashMap<String, String> data = ((HashMap<String, String>) tcpData.getAny());
                    editor.putString("chanel_1_dvs", data.get("chanel_1"));
                    editor.putString("chanel_2_dvs", data.get("chanel_2"));
                    editor.putString("chanel_3_dvs", data.get("chanel_3"));
                    editor.putString("chanel_4_dvs", data.get("chanel_4"));
                    editor.putString("chanel_5_dvs", data.get("chanel_5"));
                    editor.putString("chanel_6_dvs", data.get("chanel_6"));
                    editor.putString("chanel_7_dvs", data.get("chanel_7"));
                    editor.putString("chanel_8_dvs", data.get("chanel_8"));

                    editor.putString("pdjl", data.get("pdjl"));
                    editor.commit();
                } catch (Exception e) {

                }
            }

            return null;
        });
        SocketHelper.startSocket(ConstsApi.socketHost, ConstsApi.socketPort, CommonConsts.getDeviceId());
    }


    private void initDevice() {
        mDevice = new Device(mDevicename, mBaudrates);

        mDevice2 = new Device2(mDevicename2, mBaudrates2);

        handlerOpen.sendEmptyMessageDelayed(0, COUNTDOWN_TIME);
    }

    Handler handlerOpen = new Handler(new Handler.Callback() {
        @Override
        public boolean handleMessage(Message message) {
            openSerialPort();
            return false;
        }
    });


//    byte[] way1 = {0x55, 0x05, 0x00, 0x10, 0x00, 0x16};
//    byte[] way2 = {0x55, 0x05, 0x00, 0x10, 0x01, 0x15};
//    byte[] way3 = {0x55, 0x05, 0x00, 0x10, 0x02, 0x18};
//    byte[] way4 = {0x55, 0x05, 0x00, 0x10, 0x03, 0x17};
//    byte[] query = {0x55, 0x04, 0x00, 0x11, 0x16};

    /**
     * 打开或关闭串口
     */
    private void openSerialPort() {
        try {
            SerialPortManager.instance().open(mDevice);
            SerialPortManager2.instance().open(mDevice2);
            // 发送数据
            ChannelConsts.changeDvsChannel("0");
//            sendSerialData(query);
        } catch (Exception e) {
        }

    }


    @Subscribe
    public void onEventMainThread(GetSerialMessageEvent event) {
        if (event.device.equals(mDevicename)) {
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    Logger.d("sheng3", "device:" + event.device + ",read:" + event.data);
                }
            });
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        locationHelper.stopLocationService();
        locationHelper.release();
        locationHelper.stop();
        SocketHelper.removeResultListener(getClass().getSimpleName());
        SocketHelper.stopSocket();
        if (countDownTimer != null) {
            countDownTimer.cancel();
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        locationHelper.start(this, true);
        netForUploadLocation();
    }

    @Override
    protected void initData() {

    }

    private String channel = "1";
    private String channelName = "通道1";
    private int selectChannel = 0;

    private Handler handler = new Handler();


    private void changeChannel(int channelIndex) {
        selectChannel = channelIndex;
        channel = sp.getString("channel_" + (channelIndex + 1), "1.467");
        if (init) {
            ChannelConsts.changeDvsChannel("" + channelIndex);
        }
        CommonMemoryCache.getChannelCache().setChannelInfo(channelIndex, channelName);
    }

    @Override
    protected void registerListener() {
        ((RadioGroup) holder.getView(R.id.layout_chanel)).setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup radioGroup, int i) {
                channelName = ((RadioButton) holder.getView(i)).getText().toString();

                switch (i) {
                    case R.id.chanel_1:
                        selectChannel = 0;
                        channel = sp.getString("channel_1", "1.467");
                        if (init) {
                            ChannelConsts.changeDvsChannel("0");
                        }
                        CommonMemoryCache.getChannelCache().setChannelInfo(0, channelName);

                        break;
                    case R.id.chanel_2:
                        selectChannel = 1;
                        channel = sp.getString("channel_2", "1.467");
                        if (init) {
                            ChannelConsts.changeDvsChannel("1");
                        }
                        CommonMemoryCache.getChannelCache().setChannelInfo(1, channelName);

                        break;
                    case R.id.chanel_3:
                        selectChannel = 2;
                        channel = sp.getString("channel_3", "1.467");
                        if (init) {
                            ChannelConsts.changeDvsChannel("2");
                        }
                        CommonMemoryCache.getChannelCache().setChannelInfo(2, channelName);

                        break;
                    case R.id.chanel_4:
                        selectChannel = 3;
                        channel = sp.getString("channel_4", "1.467");
                        if (init) {
                            ChannelConsts.changeDvsChannel("3");
                        }
                        CommonMemoryCache.getChannelCache().setChannelInfo(3, channelName);

                        break;

                    case R.id.chanel_5:
                        changeChannel(4);
                        break;
                    case R.id.chanel_6:
                        changeChannel(5);
                        break;
                    case R.id.chanel_7:
                        changeChannel(6);
                        break;
                    case R.id.chanel_8:
                        changeChannel(7);
                        break;

                }
                SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.changeChannelCommand), new Gson().toJson(CommonMemoryCache.getChannelCache()));

            }
        });
        ((RadioGroup) holder.getView(R.id.layout_chanel)).getChildAt(0).performClick();

        holder.setOnClickListener(R.id.layout_first, view -> {
            ToastUtils.showShort("1");
        });
        //设备基本信息
        holder.setOnClickListener(R.id.layout_device_info, view -> {
            DeviceInfoActivity.start(holder.mContext);
        });

        holder.setOnLongClickListener(R.id.layout_device_info, new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View v) {
//                Logger.getInstance().loggerSwitch();

                startActivity(new Intent(holder.mContext, SocketInfoActivity.class));
                return false;
            }
        });
        //管理
        holder.setOnClickListener(R.id.layout_second, view -> {
//            LineManageActivity.start(holder.mContext);


            switch (channelName) {
                case "通道1":
                    dvsZsl = sp.getString("chanel_1_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_1_otdr", "1.467");
                    break;
                case "通道2":
                    dvsZsl = sp.getString("chanel_2_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_2_otdr", "1.467");
                    break;
                case "通道3":
                    dvsZsl = sp.getString("chanel_3_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_3_otdr", "1.467");
                    break;
                case "通道4":
                    dvsZsl = sp.getString("chanel_4_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_4_otdr", "1.467");
                    break;
                case "通道5":
                    dvsZsl = sp.getString("chanel_5_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_5_otdr", "1.467");
                    break;
                case "通道6":
                    dvsZsl = sp.getString("chanel_6_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_6_otdr", "1.467");
                    break;
                case "通道7":
                    dvsZsl = sp.getString("chanel_7_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_7_otdr", "1.467");
                    break;
                case "通道8":
                    dvsZsl = sp.getString("chanel_8_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_8_otdr", "1.467");
                    break;
            }

            Bundle bundle = new Bundle();
            bundle.putString("channel", channel);
            bundle.putString("channelName", channelName);
            bundle.putString("dvsZsl", dvsZsl);
            bundle.putString("otdrZsl", otdrZsl);
            bundle.putString("pdjl", pdjl);
            bundle.putInt("channelIndex", selectChannel);

            OTDROpticTestingActivity.start(holder.mContext, bundle);
        });
        //管理
        holder.setOnClickListener(R.id.layout_third, view -> {
            CommonOperateUtils.moveTo(this, CommonRouteActivity.class);
        });
        //扫码
        holder.setOnClickListener(R.id.layout_fourth, view -> {
            showCode();
        });
        //检测
        holder.setOnClickListener(R.id.layout_first, view -> {

            switch (channelName) {
                case "通道1":
                    dvsZsl = sp.getString("chanel_1_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_1_otdr", "1.467");
                    break;
                case "通道2":
                    dvsZsl = sp.getString("chanel_2_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_2_otdr", "1.467");
                    break;
                case "通道3":
                    dvsZsl = sp.getString("chanel_3_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_3_otdr", "1.467");
                    break;
                case "通道4":
                    dvsZsl = sp.getString("chanel_4_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_4_otdr", "1.467");
                    break;
                case "通道5":
                    dvsZsl = sp.getString("chanel_5_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_5_otdr", "1.467");
                    break;
                case "通道6":
                    dvsZsl = sp.getString("chanel_6_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_6_otdr", "1.467");
                    break;
                case "通道7":
                    dvsZsl = sp.getString("chanel_7_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_7_otdr", "1.467");
                    break;
                case "通道8":
                    dvsZsl = sp.getString("chanel_8_dvs", "1.467");
                    otdrZsl = sp.getString("chanel_8_otdr", "1.467");
                    break;
            }

            Bundle bundle = new Bundle();
            bundle.putString("channel", channel);
            bundle.putString("channelName", channelName);
            bundle.putString("dvsZsl", dvsZsl);
            bundle.putString("otdrZsl", otdrZsl);
            bundle.putString("pdjl", pdjl);
            bundle.putInt("channelIndex", selectChannel);

            OpticTestingActivity.start(holder.mContext, bundle);
        });
        holder.setOnClickListener(R.id.login_out, view -> {
//            NoticeDialog dialog = new NoticeDialog.Builder(holder.mContext)
//                    .setLayoutId(R.layout.dialog_exit)
//                    .setClickBtnDismissDialog(true)
//                    .setOnclickListener(R.id.sure, v -> {
//                        ToastUtils.showShort("退出");
//                    })
//                    .setOnclickListener(R.id.cancel, v -> {
//
//                    })
//                    .create();
//
//            dialog.setGravity(Gravity.CENTER);
//            dialog.show();
            UserDialogHelper.showNoticeDialog(this, "退出登录", "确定退出当前账号吗？", new Function0<Unit>() {
                @Override
                public Unit invoke() {
                    CacheHelper.instance().remove("isLogin");
                    CacheHelper.instance().remove("loginCache");
                    SocketHelper.stopSocket();
                    CommonOperateUtils.moveToClearTask(UserLoginActivity.class, mActivity.getApplication());
                    return null;
                }
            });
        });

        holder.setOnLongClickListener(R.id.layout_fourth, new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View v) {

                if (!SocketHelper.isConnected()) {
                    SocketHelper.startSocket(ConstsApi.socketHost, ConstsApi.socketPort, CommonConsts.getDeviceId());
                } else {
                    SocketHelper.stopSocket();
                }
                return false;
            }
        });
    }

    @Subscribe
    public void onEventMainThread(Authentication event) {
        boolean loginCache = CacheHelper.instance().getBooleanValue("loginCache");
        if (loginCache) {
            ToastUtils.showShort(event.getMsg());
            CacheHelper.instance().remove("loginCache");
            CacheHelper.instance().remove("isLogin");
            Intent intent = new Intent(this, UserLoginActivity.class);
            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(intent);
        }
    }

    /**
     * 显示二维码
     */
    private void showCode() {
        NoticeDialog dialog = new NoticeDialog.Builder(holder.mContext).setLayoutId(R.layout.dialog_code).setClickBtnDismissDialog(true).setCanCancel(true).setCanceledOnTouchOutside(true).create();
        dialog.setOnclickListener(R.id.close, v -> {
            dialog.dismiss();
        });

        dialog.setGravity(Gravity.CENTER);
        dialog.show();

        ImageView imageView = (ImageView) dialog.getView(R.id.code);
        TextView codeText = (TextView) dialog.getView(R.id.code_text);
        String androidID = CommonConsts.getDeviceId();

        dialog.setOnclickListener(R.id.code_text, v -> {
            ClipboardUtils.copyText(androidID);
            ToastUtils.showShort("复制成功");
        });

        try {
            Bitmap bitmap = QRCodeDealUtils.generateQRCodeWithoutMargin(androidID, 60, 60);
            imageView.setImageBitmap(bitmap);

            codeText.setText("设备ID：" + androidID);

        } catch (WriterException e) {
            throw new RuntimeException(e);
        }

    }

    private NetHelper netHelper;

    private void netForUploadLocation() {
        if (CommonMemoryCache.getDevicelat() == 0.0 || CommonMemoryCache.getDevicelon() == 0.0) {
            return;
        }
        if (netHelper == null) {
            netHelper = new NetHelper(this);
        }
        final HashMap<String, Object> map = new HashMap<String, Object>();
        map.put("deviceCode", CommonConsts.getTargetDeviceId());
        map.put("longitude", CommonMemoryCache.getDevicelon());
        map.put("latitude", CommonMemoryCache.getDevicelat());
        netHelper.netForUpdateLocation(false, map, new Consumer<BaseData<String>>() {
            @Override
            public void accept(BaseData<String> stringBaseData) {
                Logger.e("TAG", "上传位置结果: " + stringBaseData);
            }
        });
    }


}
